import { SuggestionResponse, SearchResultResponse } from './../types/data.d'
import { http } from '@/utils'

// 获取搜索联想词
type ParmasSuggest = {
  q: string
}
export function getSuggestion(
  parmas: ParmasSuggest
): Promise<SuggestionResponse> {
  return http({ url: '/suggestion', params: parmas })
  // return http.get('/suggestion', { params: parmas })
}

// 获取搜索结果列表
type ParmasSearch = {
  q: string
  page: number
}
export function getSearchList(
  parmas: ParmasSearch
): Promise<SearchResultResponse> {
  return http.get('/search', { params: parmas })
}
